package com.yc.sole.erp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.sole.erp.enums.ShipmentType;
import com.yc.sole.framework.mybatis.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 送货表
 *
 * @author yizuomin
 * @date 2024/1/16 10:48
 **/
@Data
@Entity
@Table(name = "erp_shipment")
@TableName(value = "erp_shipment", autoResultMap = true)
public class Shipment extends BaseEntity {

    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 送货单号
     */
    @Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '送货单号'", unique = true)
    private String shipmentNo;
    /**
     * 送货日期
     */
    @Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '送货日期'")
    private String shipmentDate;
    /**
     * 送货数量
     */
    @Column(columnDefinition = "INT UNSIGNED NOT NULL COMMENT '送货数量'")
    private Integer quantity;
    /**
     * 客户id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '客户id'")
    private Long customerId;
    /**
     * 客户名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '客户名称'")
    private String customerName;
    /**
     * 送货方式
     */
    @Column(columnDefinition = "TINYINT NOT NULL COMMENT '送货方式'")
    private ShipmentType shipmentType;
    /**
     * 承运商/物流公司
     */
    @Column(columnDefinition = "VARCHAR(50) COMMENT '承运商/物流公司'")
    private String carrier;
    /**
     * 物流单号
     */
    @Column(columnDefinition = "VARCHAR(32) COMMENT '物流单号'")
    private String trackingNo;
    /**
     * 运费
     */
    @Column(columnDefinition = "DECIMAL(18,2) COMMENT '运费'")
    private BigDecimal shipCost;
    /**
     * 收件人名称
     */
    @Column(columnDefinition = "VARCHAR(50) COMMENT '收件人名称'")
    private String recipientName;
    /**
     * 收件人手机号
     */
    @Column(columnDefinition = "VARCHAR(20) COMMENT '收件人手机号'")
    private String recipientPhoneNum;
    /**
     * 送货地址
     */
    @Column(columnDefinition = "VARCHAR(255) COMMENT '送货地址'")
    private String recipientAddress;
    /**
     * 总金额
     */
    @Column(columnDefinition = "DECIMAL(18,2) NOT NULL COMMENT '总金额'")
    private BigDecimal amount;
    /**
     * 备注
     */
    @Column(columnDefinition = "VARCHAR(255) COMMENT '备注'")
    private String remark;
    /**
     * 是否删除
     */
    @TableLogic
    @Column(columnDefinition = "INT NOT NULL DEFAULT 0 COMMENT '是否已删除'")
    private Integer deleted;
}
